package com.huilian.iotbox.admin.wap.service.impl;

import com.huilian.iotbox.admin.wap.dao.CommodityProjectRelevanceDao;
import com.huilian.iotbox.admin.wap.service.CommodityProjectRelevanceService;
import com.huilian.iotbox.data.po.CommodityProjectRelevance;
import com.huilian.iotbox.data.vo.CommodityProjectRelevanceVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommodityProjectRelevanceServiceImpl implements CommodityProjectRelevanceService {

    @Autowired
    private CommodityProjectRelevanceDao commodityProjectRelevanceDao;

    @Override
    public int insert(CommodityProjectRelevance cpr) {
        return commodityProjectRelevanceDao.insert(cpr);
    }

    @Override
    public List<CommodityProjectRelevanceVo> findCommodityProjectRelevanceByCommodityId(Long commodityId) {
        return commodityProjectRelevanceDao.findCommodityProjectRelevanceByCommodityId(commodityId);
    }

    @Override
    public int update(CommodityProjectRelevance commodityProjectRelevance) {
        return commodityProjectRelevanceDao.update(commodityProjectRelevance);
    }

    @Override
    public void delete(Integer cprId) {
        commodityProjectRelevanceDao.delete(cprId);
    }
}
